package com.zjy.springbootinit.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @Autowired
    Environment env;
    @RequestMapping("/hello")
    public String hello(){
        System.out.println("李四我的第一个SpringBoot项目！");
        return "我是李四，这是我的第一个SpringBoot项目！当前端口是："+env.getProperty("server.port+");
    }

}
